package com.guigu.www.tangyingmeng.controller;

import com.guigu.www.pojo.*;
import com.guigu.www.tangyingmeng.service.TymSchemeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/scheme")
public class TymschemeController {

    @Autowired
    private TymSchemeService service;

    @PostMapping("/selschemeall")
    public PageVo<BespeakResult> selschemeall (@RequestBody Map<String,String> map) {
        PageVo<BespeakResult> pageVo = service.selschemeall(map);
        return pageVo;
    }

    @GetMapping("/selschemeone/{id}")
    public BespeakResult selschemeone (@PathVariable("id") Integer id) {
        BespeakResult result = service.selschemeone(id);
        return result;
    }

    @PostMapping("/selfoodall")
    public List<FoodZong> selfoodall(){
        List<FoodZong> list = service.selfoodall();
        return list;
    }

    @PostMapping("/selkeepall")
    public List<KeepZong> selkeepall(){
        List<KeepZong> list = service.selkeepall();
        return list;
    }

    @PostMapping("/selwhoall")
    public List<TemplateWholesome> selwhoall(){
        List<TemplateWholesome> list = service.selwhoall();
        return list;
    }

    @PostMapping("/seltemplateall")
    public List<InterventionTemplate> seltemplateall(){
        List<InterventionTemplate> list = service.seltemplateall();
        return list;
    }

    @PostMapping("/subscheme")
    public Boolean subscheme (@RequestBody Intervention intervention){
        Boolean falg = service.subscheme(intervention);
        return falg;
    }

}
